# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>

pkgname=libxcb
pkgver=1.12
pkgrel=1
pkgdesc="X11 client-side library"
arch=('i686' 'x86_64')
url="https://xcb.freedesktop.org/"
depends=('xcb-proto>=1.12' 'libxdmcp' 'libxau')
makedepends=('libxslt' 'python' 'xorg-util-macros')
license=('custom')
source=($url/dist/$pkgname-$pkgver.tar.bz2
        libxcb-1.1-no-pthread-stubs.patch
        python-35x-fixes.patch)
sha256sums=('4adfb1b7c67e99bc9c2ccb110b2f175686576d2f792c8a71b9c8b19014057b5b'
            '37debaf892235a516a50a4975e6229538d3b4696b4571a8dea05eed774004aff'
            'e66140ac2270b47e940db82975e2d28d3536ca1bd0eae63bce3b900ed81fa517')

prepare() {
  cd "$pkgname-$pkgver"
  patch -Np1 -i ../libxcb-1.1-no-pthread-stubs.patch
  patch -Np1 -i ../python-35x-fixes.patch
  autoreconf -vfi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr \
    --enable-xinput \
    --enable-xkb \
    --disable-static
  make -j1
}

check() {
  cd $pkgname-$pkgver
  make -k check
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  install -m755 -d "$pkgdir/usr/share/licenses/$pkgname"
  install -m644 COPYING "$pkgdir/usr/share/licenses/$pkgname"
}
